package action;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import bean.Fundraising_project;
import dao.Fundraising_projectDao;

public class Fundraising_projectServlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String page = req.getParameter("page");

		ArrayList<Fundraising_project> fundraising_project_list = new Fundraising_projectDao()
				.getAllFundraising_project();
		
		HttpSession session = req.getSession();
		session.setAttribute("fundraising_project_list", fundraising_project_list);
		
		resp.sendRedirect(page);
	}

}
